<?php

abstract class Soul_Template_Html_Element extends Soul_Template_Html_Tag{

	protected $templateName = NULL;

	public function toHtml() {
		if (!empty($this->templateName)) {
			if(count(Soul_Config::$templateDirectories)> 0){
				$file = Soul_Util_FS::findFile(Soul_Config::$templateDirectories, $this->templateName.'.phtml');
				if(!is_null($file)){
					ob_start();
					include $file;
					return ob_get_clean();
				}
			}
		}
		return $this->render();
	}
}